export const isFunction = (target) => {
  return typeof target === 'function'
}

export const isEmptyObject = (target) => {
  if (!isObject(target)) {
    return false
  }
  return Object.keys(target).length === 0
}

export const isBoolean = (target) => {
  return typeof target === 'boolean'
}

export const isString = (target) => {
  return typeof target === 'string'
}

export const isObject = (target) => {
  return Object.prototype.toString.call(target) === '[object Object]'
}

export const isPromise = (target) => {
  return target instanceof Promise
}

export const isArray = (target) => {
  return Array.isArray(target)
}

export const isNumber = (target) => {
  return typeof target === 'number'
}

export const isArrayOfString = (target) => {
  return isArray(target) && target.every(item => (typeof item === 'string'))
}

export const isAsyncFunction = (fn) => {
  return fn.constructor.name === 'AsyncFunction';
}
